<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Mod_service extends CI_Controller {
   
    function  __construct(){
        parent::__construct(); 
    }
    public function index(){
        $menuChoice = $this->common_model->getone('danhmuctt',array('publish'=>1,'position'=>2));
        $selectAlias = $this->common_model->getdata('alias',array('type'=>'danhmuctt'));
        foreach ($selectAlias as $ali){
            $dataAlias[$ali->a_id] = $ali ;
        }
        $getAlias = $this->common_model->getdata('alias',array('type'=>'tintuc'));
            foreach ($getAlias as $ali){
                $dataAliastt[$ali->a_id] = $ali ;
            }
        if(!empty($menuChoice)){
            
            $objNewChoice = $this->common_model->getdata('tintuc',array('publish'=>1,'noibat'=>1,'iddanhmuc'=>$menuChoice->id),'',array('id','desc'),7);
        }
        $menuService = $this->common_model->getdata('danhmuctt',array('publish'=>1,'stand'=>1));
        if(!empty($menuService)){
            foreach ($menuService as $mns){
                $arrayNewService[$mns->id] = $this->common_model->getdata('tintuc',array('publish'=>1,'noibat'=>1,'iddanhmuc'=>$mns->id),'',array('id','desc'),3);
            }
        }
        return $this->load->view('mod_service/views',array('menuChoice'=>$menuChoice,'objNewChoice'=>$objNewChoice,'menuService'=>$menuService,'arrayNewService'=>$arrayNewService,'dataAlias'=>$dataAlias,'dataAliastt'=>$dataAliastt));
    }
    
}

   